<div class="span2">
    <div id="calendar">
        <?php echo $this->calendar->generate(); ?>
    </div>

    <div class="sidebar_box">
        <h4 style="color:grey !important;">Anstehende Schulungen</h4>

        <?php if (empty($entered_training) && empty($invoiced_trainings)): ?>
            <div>
                Keine anstehenden Schulungen!
            </div>               
        <?php else : ?>
            <?php foreach ($entered_trainings as $entered_training): ?>
                <span class="date"><?php echo strftime("%A, %d.%m.%Y", strtotime($entered_training->appointment_from)); ?></span>
                <?php echo anchor('/training/details/' . $entered_training->id, 
                                  '<div class="orange_box">
                                      <b>'. 
                                        $entered_training->traininggroup()->course()->title . 
                                     '</b> (ID:' . $entered_training->id . ')</div>'); ?>
            <?php endforeach; ?>
            <?php foreach ($invoiced_trainings as $invoiced_training): ?>
                <span class="date"><?php echo strftime("%A, %d.%m.%Y", strtotime($invoiced_training->appointment_from)); ?></span>
                <?php echo anchor('/training/details/' . $invoiced_training->id, 
                                  '<div class="orange_box">
                                      <b>'. 
                                        $invoiced_training->traininggroup()->course()->title . 
                                     '</b> (ID:' . $invoiced_training->id . ')</div>'); ?>
            <?php endforeach; ?>
        <?php endif; ?>
    </div>

    <div class="sidebar_box">
        <h4>Offene Schulungen</h4>

        <?php if (empty($approaching_trainings) && empty($determined_trainings)): ?>
            <div>
                Keine offenen Schulungen!
            </div>               
        <?php else : ?>
            <?php foreach ($approaching_trainings as $approaching_training): ?>
                <?php echo anchor('/training/details/' . $approaching_training->id, 
                                  '<div class="blue_box">
                                      <b>'. 
                                        $approaching_training->traininggroup()->course()->title . 
                                     '</b> (ID:' . $approaching_training->id . ')</div>'); ?>
            <?php endforeach; ?>
            <?php foreach ($determined_trainings as $determined_training): ?>
                <?php echo anchor('/training/details/' . $determined_training->id, 
                                  '<div class="blue_box">
                                      <b>'. 
                                        $determined_training->traininggroup()->course()->title . 
                                     '</b> (ID:' . $determined_training->id . ')</div>'); ?>
            <?php endforeach; ?>
        <?php endif; ?>
    </div>
</div>